﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveCameraByClick : MonoBehaviour {

    public Vector3 v_sifangCamPos;         //“四方”设备的局部视角
    public Vector3 v_sifangCamRot;         //“四方”设备的局部视角
    public Vector3 v_onllyCamPos;          //“onlly”设备的局部视角
    public Vector3 v_onllyCamRot;          //“onlly”设备的局部视角
    public Vector3 v_quanjuCamPos;         //全局视角
    public Vector3 v_quanjuCamRot;         //全局视角
    public Vector3 v_kongqikaiguanCamPos;  //空氣開關視角
    public Vector3 v_kongqikaiguanCamRot;  //空氣開關視角
    public Vector3 v_kaiguanCamPos;        //Onlly開關視角
    public Vector3 v_kaiguanCamRot;        //Onlly開關視角

    // Use this for initialization
    void Start () {
    }

    /// <summary>
    /// 右上角UI的点击（局部视角,全局视角的切换）
    /// </summary>
    /// <param name="name"></param>
    public void OnUIClick(string name)
    {
        if (!StartUIController._instance.b_isMask) {
            switch (name)
            {
                case "sifang":
                    GameObject.Find("Main Camera").transform.position = v_sifangCamPos;
                    GameObject.Find("Main Camera").transform.eulerAngles = v_sifangCamRot;
                    break;
                case "onlly":
                    GameObject.Find("Main Camera").transform.position = v_onllyCamPos;
                    GameObject.Find("Main Camera").transform.eulerAngles = v_onllyCamRot;
                    break;
                case "quanju":
                    GameObject.Find("Main Camera").transform.position = v_quanjuCamPos;
                    GameObject.Find("Main Camera").transform.eulerAngles = v_quanjuCamRot;
                    break;
                case "kongqikaiguan":
                    GameObject.Find("Main Camera").transform.position = v_kongqikaiguanCamPos;
                    GameObject.Find("Main Camera").transform.eulerAngles = v_kongqikaiguanCamRot;
                    break;
                case "kaiguan":
                    GameObject.Find("Main Camera").transform.position = v_kaiguanCamPos;
                    GameObject.Find("Main Camera").transform.eulerAngles = v_kaiguanCamRot;
                    break;
                default: break;
            }
        }       
    }
}
